package com.joe.utils.entity;

import java.util.ArrayList;
import java.util.Random;

/**
 * Created by joe on 2019/1/15
 */
public class RandomList<T> extends ArrayList<T>{

    private final Random random = new Random();

    public T select() {
        return get(random.nextInt(this.size()));
    }

    public T randomRemove() {
        return remove(random.nextInt(this.size()));
    }

}
